﻿CREATE TABLE [dbo].[forum_Thread] (
    [ThreadId]   BIGINT           IDENTITY (1, 1) NOT NULL,
    [SectionId]  SMALLINT         NOT NULL,
    [IsSolved]   BIT              CONSTRAINT [DF_forum_Thread_IsSolved] DEFAULT ((0)) NOT NULL,
    [Name]       NVARCHAR (128)   NOT NULL,
    [CreatedBy]  UNIQUEIDENTIFIER NOT NULL,
    [CreateDate] DATETIME         CONSTRAINT [DF_forum_Thread_CreateDate] DEFAULT (getutcdate()) NOT NULL,
    [UpdateBy]   UNIQUEIDENTIFIER NULL,
    [UpdateDate] DATETIME         NULL,
    CONSTRAINT [PK_forum_Thread] PRIMARY KEY CLUSTERED ([ThreadId] ASC)
);












GO
CREATE NONCLUSTERED INDEX [IX_forum_Thread_SectionId]
    ON [dbo].[forum_Thread]([SectionId] ASC);


GO
CREATE NONCLUSTERED INDEX [IX_forum_Thread_CreateDate]
    ON [dbo].[forum_Thread]([CreateDate] ASC);


GO
CREATE NONCLUSTERED INDEX [IX_forum_Thread_CreateBy]
    ON [dbo].[forum_Thread]([CreatedBy] ASC);

